﻿
//Author: 张亚涛
//createtime:2015-12-24 18:31:32
//Description: 

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Model
{
    public class Coupons
    {
        public Coupons()
        { }
        public Coupons(IDataReader reader)
        {
            _id = int.Parse(reader["ID"].ToString());
            if (reader["OpenID"] != DBNull.Value)
            {
                _openID = reader["OpenID"].ToString();
            }
            if (reader["Money"] != DBNull.Value)
            {
                _money = decimal.Parse(reader["Money"].ToString());
            }
            if (reader["Explain"] != DBNull.Value)
            {
                _explain = reader["Explain"].ToString();
            }
            if (reader["YouXQStart"] != DBNull.Value)
            {
                _youXQStart = DateTime.Parse(reader["YouXQStart"].ToString());
            }
            if (reader["YouXQEnd"] != DBNull.Value)
            {
                _youXQEnd = DateTime.Parse(reader["YouXQEnd"].ToString());
            }
            if (reader["CouType"] != DBNull.Value)
            {
                _couType = int.Parse(reader["CouType"].ToString());
            }
            if (reader["IsUse"] != DBNull.Value)
            {
                _isUse = int.Parse(reader["IsUse"].ToString());
            }
            if (reader["TradeID"] != DBNull.Value)
            {
                _tradeID = int.Parse(reader["TradeID"].ToString());
            }
        }

        #region 数据库字段
        private int _id;
        private string _openID;
        private decimal _money;
        private string _explain;
        private DateTime? _youXQStart;
        private DateTime? _youXQEnd;
        private int _couType;
        private int _isUse;
        private int _tradeID;
        #endregion

        #region 字段属性
        /// <summary>
        /// 优惠券ID
        /// </summary>
        public int Id
        {
            set { _id = value; }
            get { return _id; }
        }
        /// <summary>
        /// 微信ID
        /// </summary>
        public string OpenID
        {
            set { _openID = value; }
            get { return _openID; }
        }
        /// <summary>
        /// 金额
        /// </summary>
        public decimal Money
        {
            set { _money = value; }
            get { return _money; }
        }
        /// <summary>
        /// 说明
        /// </summary>
        public string Explain
        {
            set { _explain = value; }
            get { return _explain; }
        }
        /// <summary>
        /// 有效开始日期
        /// </summary>
        public DateTime? YouXQStart
        {
            set { _youXQStart = value; }
            get { return _youXQStart; }
        }
        /// <summary>
        /// 有效结束日期
        /// </summary>
        public DateTime? YouXQEnd
        {
            set { _youXQEnd = value; }
            get { return _youXQEnd; }
        }
        /// <summary>
        /// 类型(0：优惠券1：洗车券)
        /// </summary>
        public int CouType
        {
            set { _couType = value; }
            get { return _couType; }
        }
        /// <summary>
        /// 使用标识(0未使用1已使用)
        /// </summary>
        public int IsUse
        {
            set { _isUse = value; }
            get { return _isUse; }
        }
        /// <summary>
        /// 购买交易ID
        /// </summary>
        public int TradeID
        {
            set { _tradeID = value; }
            get { return _tradeID; }
        }
        #endregion

        #region 扩展属性
        private string _tip = "";
        /// <summary>
        /// 提示
        /// </summary>
        public string Tip
        {
            set { _tip = value; }
            get { return _tip; }
        }
        private string _css = "stamp01";
        /// <summary>
        /// 样式
        /// </summary>
        public string Css
        {
            set { _css = value; }
            get { return _css; }
        }
        #endregion
    }
}